<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<form action="/insert" method="post">
    <input type="text" name="content">
    <input type="submit" th:value="评论">
</form>
<div th:each="comment:${all}">
    <div th:text="${comment.articleid}" style="display: none"></div>
    <div th:text="${comment.userid}" style="display: none"></div>

    <p> 留言人：<span th:text="${comment.nickname}"></span>     留言时间：<span th:text="${comment.createdatetime}"></span></p>
    <div th:text="${comment.content}"></div>
    点赞人数<span th:text="${comment.likenum}"></span><a th:href="@{/remove/(id=${comment.get_id()})}">删除</a>
    <div> <span th:if="${comment.replynum} le 0"><a href="#" >回复·</a><a href="#" >0条</a></span>
        <div  th:if="${comment.replynum} gt 0">
            <a href="#" onclick="sh2()">回复·</a><a href="#" id="but" onclick="aa()"><span th:text="${comment.replynum}"></span>条>>></a>
            <div style="display: none" id="show2">
                        <form action="#" method="post">
                            <input type="text" name="content">
                            <input type="submit" value="回复">
                            <input type="button" value="关闭" onclick="c2()">
                        </form>
            </div>
            <div id="show" style="display: none;text-indent: 4em">
                <p>回复人：<span th:text="${comment.nickname}"></span>     回复时间：<span th:text="${comment.createdatetime}"></span></p>
                <div th:text="${comment.content}"></div>

                <a id="sq" href="#" onclick="sq()">收起</a>
            </div>
        </div>
    </div>
    <hr>
</div>
<script>
    function aa() {
        document.getElementById("show").style.display="block";
    }
    function sq() {
        document.getElementById("show").style.display="none";
    }
    function sh2() {
        document.getElementById("show2").style.display="block";
    }
    function c2() {
        document.getElementById("show2").style.display="none";
    }
</script>
</div>

</body>



</html>